@extends('admin.conn.main')

@section('content')
<!--页面主要内容-->
<main class="lyear-layout-content">

    <div class="container-fluid">

        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-toolbar clearfix">
                        <div class="col-lg-6" style="float: right">
                            <div class="input-group">
                                <input type="text" class="form-control" placeholder="请输入关键词...">
                                <span class="input-group-btn">
                                  <button class="btn btn-default" type="button">搜索</button>
                                </span>
                            </div>
                        </div>
                        <div class="toolbar-btn-action">
                            <button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg">新增</button>
                            <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
                                <div class="modal-dialog modal-lg" role="document">
                                    <div class="modal-content">
                                        <div class="modal-header">
                                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                                            <h4 class="modal-title" id="myLargeModalLabel">用户添加</h4>
                                        </div>
                                        <div class="modal-body">
                                            @include('admin.conn.msg')
                                            <form action="{{route('admin.user.store')}}" method="post">
                                                @csrf
                                                <div class="form-group">
                                                    <label for="example-text-input">用户名:</label>
                                                    <input class="form-control" type="text" id="example-text-input" name="username" placeholder="用户名">
                                                </div>
                                                <div class="form-group">
                                                    <label for="example-text-input">姓名:</label>
                                                    <input class="form-control" type="text" id="example-text-input" name="realname" placeholder="真实姓名">
                                                </div>
                                                <div class="form-group">
                                                    <label for="example-nf-email">邮箱:</label>
                                                    <input class="form-control" type="email" id="example-nf-email" name="email" placeholder="请输入邮箱..">
                                                </div>
                                                <div class="form-group">
                                                    <label for="example-nf-password">手机号</label>
                                                    <input class="form-control" type="text" id="example-nf-phone" name="phone" placeholder="请输入手机号..">
                                                </div>
                                                <div class="form-group">
                                                    <label for="example-nf-password">密码</label>
                                                    <input class="form-control" type="password" id="example-nf-password" name="password" placeholder="请输入密码..">
                                                </div>
                                                <div class="form-group">
                                                    <label for="example-nf-password">确认密码</label>
                                                    <input class="form-control" type="password" id="example-nf-password_confirmation" name="password_confirmation" placeholder="请输入密码..">
                                                </div>
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                                    <button type="submit" class="btn btn-primary">点击添加</button>
                                                </div>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="card-body">

                        <div class="table-responsive">
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>
                                        <label class="lyear-checkbox checkbox-primary">
                                            <input type="checkbox" id="check-all"><span></span>
                                        </label>
                                    </th>
                                    <th>编号</th>
                                    <th>用户名</th>
                                    <th>角色</th>
                                    <th>真实姓名</th>
                                    <th>性别</th>
                                    <th>邮箱</th>
                                    <th>手机号</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($data as $v)
                                    <tr>
                                        <td>
                                            <label class="lyear-checkbox checkbox-primary">
                                                @if(auth()->id() != $v->id)
                                                    @if($v->deleted_at == null)
                                                        <input type="checkbox" name="ids[]" value="{{$v->id}}"><span></span>
                                                    @endif
                                                @endif
                                            </label>
                                        </td>
                                        <td>{{$v['id']}}</td>
                                        <td>{{$v['username']}}</td>
                                        <td>{{$v['role_id']}}</td>
                                        <td>{{$v['truename']}}</td>
                                        <td>{{$v['sex']}}</td>
                                        <td>{{$v['email']}}</td>
                                        <td>{{$v['phone']}}</td>
                                        <td><font class="text-success">正常</font></td>
                                        <td>
                                            <div class="btn-group">
                                                <a class="btn btn-xs btn-default" href="#!" title="编辑" data-toggle="tooltip"><i class="mdi mdi-pencil"></i></a>
                                                <a class="btn btn-xs btn-default" href="{{route('admin.user.destroy',['id'=>$v->id])}}" title="删除" data-toggle="tooltip"><i class="mdi mdi-window-close"></i></a>
                                            </div>
                                        </td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                        </div>
                        <ul class="pagination">
                        </ul>
                    </div>
                </div>
            </div>

        </div>

    </div>

</main>
<!--End 页面主要内容-->
@endsection
<!--End 页面主要内容-->
@section('js')

@endsection